import request from '@/utils/request'

// 查询订单列表
export function couponList(query) {
  return request({
    url: '/system/coupon/get/listForPage',
    method: 'get',
    params: query
  })
}
// 新增优惠券
export function couponAdd(data) {
  return request({
    url: '/system/coupon/add',
    method: 'post',
    data
  })
}

// 删除优惠券/system/coupon/remove/{ids}
export function couponRemove(ids) {
  return request({
    url: '/system/coupon/remove/' + ids,
    method: 'delete'
  })
}

// 启用、禁用优惠券
export function couponStatus({status, id}) {
  return request({
    url: `/system/coupon/update/${status}/by/${id}`,
    method: 'post'
  })
}

// 查看优惠券
export function couponGet(id) {
  return request({
    url: `/system/coupon/get/${id}`,
    method: 'get'
  })
}




